using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Sys_Configuration - 配置表 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class ISysConfiguration<T> :ModelBase<SysConfiguration> where T : SysConfiguration, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.ConfigId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return ConfigId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.ConfigId=dy.ConfigId;
           this.Title=dy.Title;
           this.Remark=dy.Remark;
        } 

        #region 定义属性

     
         /// <summary>
        /// Rowid
        /// </summary>
        private int _ConfigId =int.MinValue;
      
        /// <summary>
        /// Rowid
        /// </summary>
        public int ConfigId
        {
            get 
            {
              return   (this._ConfigId); 
            }

            set 
            {
                    _ConfigId= value;  
            }
        }
       
     
         /// <summary>
        /// 名称
        /// </summary>
        private String _Title = "";
      
        /// <summary>
        /// 名称
        /// </summary>
        public String Title
        {
            get 
            {
              return   (this._Title); 
            }

            set 
            {
                    _Title= value;  
            }
        }
       
     
         /// <summary>
        /// KEYA
        /// </summary>
        private String _Remark = "";
      
        /// <summary>
        /// KEYA
        /// </summary>
        public String Remark
        {
            get 
            {
              return   (this._Remark); 
            }

            set 
            {
                    _Remark= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(SysConfiguration info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["ConfigId"]!= DBNull.Value)
                  {
                  info.ConfigId=Convert.ToInt32(row["ConfigId"]);
                 }
                 
                  
                  if(row["Title"]!= DBNull.Value)
                  {
                  info.Title=row["Title"].ToString();
                 }
                 
                  
                  if(row["Remark"]!= DBNull.Value)
                  {
                  info.Remark=row["Remark"].ToString();
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, SysConfiguration info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@ConfigId", DbType.Int32,ParameterTool.GetObj( info._ConfigId )); 
            
             
                cn.AddInParameter(comm, "@Title", DbType.String,ParameterTool.GetObj( info._Title )); 
            
             
                cn.AddInParameter(comm, "@Remark", DbType.String,ParameterTool.GetObj( info._Remark )); 
            
        } 

    } 
} 